#ifndef SALSA20_H
#define SALSA20_H

#include <stdbool.h>
#include <stdint.h>

#include "crypto/ciphers/common.h"

#define SALSA20_KEYSIZE    32
#define SALSA20_IV_SIZE     8
#define SALSA20_BLOCK_SIZE 64

struct salsa20_ctx
{
	u32 input[16];
};

bool salsa20_init_context(struct salsa20_ctx *ctx, const u8 *key, const u8 *iv);

i64 salsa20_encrypt_buffer(salsa20_ctx* ctx, u8* dst, const u8* src, i64 length);

i64 salsa20_decrypt_buffer(salsa20_ctx* ctx, u8* dst, const u8* src, i64 length);

void salsa20_test();

#endif // SALSA20_H
